﻿

namespace calendar
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using calendar.Model;

    public partial class CalendarLoginForm : Form
    {
        private Logic logicmodel; 

        public CalendarLoginForm()
        {
            InitializeComponent();
            logicmodel = new Logic();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            ///////////////////////
            string userName = txtUserName.Text;
            string password = txtUserPassword.Text;
            bool IsOk = this.logicmodel.CheckUser(userName, password);
            if (IsOk == true)
            {
                // go to Calendar Form 
                MessageBox.Show("OK");
            }
            else
            {
                MessageBox.Show("Please, try again.");
            }
        }
    }
}
